#pragma once
#include <vector>
#include <D3dx11effect.h>

// Vertex format
struct VERTEX
{
    D3DXVECTOR3 position;
    D3DXVECTOR3 normal;
    D3DXVECTOR2 texcoord;
};

struct BBOX
{
	D3DXVECTOR3 min, max;

	float dx() const { return max.x - min.x; }
	float dy() const { return max.y - min.y; }
	float dz() const { return max.z - min.z; }
	D3DXVECTOR3 center() const {return (min + max) * 0.5f;}
};

// Material properties per mesh subset
struct Material
{
    WCHAR   strName[MAX_PATH];

    D3DXVECTOR3 vAmbient;
    D3DXVECTOR3 vDiffuse;
    D3DXVECTOR3 vSpecular;

    int nShininess;
    float fAlpha;

    bool bSpecular;

    WCHAR   strTexture[MAX_PATH];
    ID3D11ShaderResourceView* pTexture;
};

struct Subset 
{
	Subset()
		:startInd(0), indCount(0)
	{}

	Subset(DWORD startInd, DWORD indCount, DWORD materialId)
		:startInd(startInd), indCount(indCount), materialId(materialId)
	{}
	DWORD startInd;
	DWORD indCount;
	DWORD materialId;
};

typedef std::vector<Subset> FacesSubsets;
typedef std::vector<UINT> Indexes;
typedef std::vector<VERTEX> Vertexes;
typedef std::vector<UINT> Attributes;
typedef std::vector <Material*> Materials;